package com.auxgroup.smarthome.inner.service;

import com.auxgroup.bridge.business.inner.vo.BaseFeatureVo;
import com.auxgroup.smarthome.BeanListUtils;
import com.auxgroup.smarthome.inner.entity.BaseFeatureEntity;
import com.auxgroup.smarthome.inner.repo.BaseFeatureEntityRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by lixiaoxiao on 17-7-31.
 */
@Service
public class BaseFeatureDBService {
    @Autowired
    private BaseFeatureEntityRepo baseFeatureEntityRepo;

    /**
     * 获取功能列表
     * @return
     */
    public List<BaseFeatureVo> findAll(){
        List<BaseFeatureEntity>  baseFeatureEntities = baseFeatureEntityRepo.findAll();
        BeanListUtils beanListUtils = new BeanListUtils(BaseFeatureVo.class,baseFeatureEntities);
        return beanListUtils.getTargetList();
    }
}
